﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Selection Sort</title>
    <link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
   <div id="js-console"></div>
	<script src="scripts/js-console.js"></script>

    <script>

        var array =[ 1,-2,3,0,2,9,6,7,5];

        for (var i = 0; i < array.length; i++){
        
            for (var j = i + 1; j < array.length; j++){
            
                if (array[i] > array[j]){
                
                    var exchanger = 0;
                    exchanger = array[i];
                    array[i] = array[j];
                    array[j] = exchanger;
                 }
             }
        }
        for (var i = 0; i < array.length; i++){
        
            jsConsole.write(array[i] + " ");
        }
        jsConsole.writeLine();
    </script>
</body>
</html>
